﻿#include"game.h"

int main()
{
	srand((unsigned int)(time(NULL)));
	int input = 0;
	char board[ROW][COL];
	init_board(board);
	start_game();
	scanf("%d", &input);
	play_board(input, board);
	char ret = '0';
	do
	{
		int row = 0;
		int col = 0;
		scanf("%d %d", &row, &col);
		player_play(row, col, board);
		play_board(input, board);
		ret = judge(board);
		if (ret != 'C')
			break;

		computer_play(board);
		play_board(input, board);
		ret = judge(board);
		if (ret != 'C')
			break;

	} while (input);

	if (ret == 'Q')
	{
		printf("平局\n");
	}
	else if (ret == '1')
	{
		printf("玩家赢\n");
	}
	else if (ret == '2')
	{
		printf("电脑赢\n");
	}
}